Skip to content

Comments

fix(n-select): n-select and n-tree-select components' custom fi…#7458

Open
jahnli wants to merge 1 commit intotusen-ai:mainfrom
jahnli:fix-7034
Open

fix(n-select): n-select and n-tree-select components' custom fi…#7458
jahnli wants to merge 1 commit intotusen-ai:mainfrom
jahnli:fix-7034

Conversation

@jahnli
Copy link
Collaborator

@jahnli jahnli commented Feb 3, 2026

需要确认下此次更改是否合理

close #7034

…lter method not being called when deleting the last character
}
}
if (!pattern.length || !mergedFilterRef.value) {
if ((!pattern.length && !props.filter) || !mergedFilterRef.value) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

mergedFilterRef 里优先取的就是 props.filter

const mergedFilterRef = computed(() => {
const { filter } = props
if (filter)
return filter
const { labelField } = props
return (pattern: string, node: TreeOption): boolean => {
if (!pattern.length)
return true
const label = node[labelField]
if (typeof label === 'string') {
return label.toLowerCase().includes(pattern.toLowerCase())
}
return false
}
})

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Select组件和TreeSelect组件的自定义filter方法bug

2 participants